﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using InventoryPro.DAL;

namespace InventoryPro.BL
{
    public class EmployeeLogic
    {
        EmployeeDAO dao = new EmployeeDAO();


        public List<Employee> GetAllEmployees()
        {

            return dao.GetAllEmployees();
        }

        public Employee GetEmployeebyID(int ID)
        {
            return dao.GetEmployeebyID(ID);
        }

        public Employee Login(string LoginName,string pwd)
        {
            Employee emp = dao.Login(LoginName, pwd);
            if (emp == null)
            {
                throw new ApplicationException("Incorrect Username or Password");
            }

            return emp;

           
        }


        public void CreateEmployee(Employee employee)
        {

            dao.CreateEmployee(employee);
        }


        public void UpdateEmployee(Employee employee)
        {

            dao.UpdateEmployee(employee);
        }


        public void DeleteEmployee(int ID)
        {
            dao.DeleteEmployee(ID);

        }
    }
}
